<link rel="stylesheet" href="/media/css/moostyles.css" type="text/css">
<script type="text/javascript">
function show_alert()
{
alert("I am an alert box!");
}
</script>

<div id="framecontentLeft">
<div class="innertube">
{% include "finance/navPanel.html" %}
</div>
</div>

<div id="framecontentTop">
<div class="innertube">

<h1>Finance Manager</h1>
<h3>Quick Budget</h3>

</div>
</div>

<div id="maincontent">
<div class="innertube">
    
<table rules="groups">
        <tr>
            <th>Summary</th>
            <th>Weekly</th>
            <th>Monthly</th>
            <th>Yearly</th>
        </tr>
        {% for item in summary %}
        <tr>
            <td>{{ item.Name }}</td>
            <td class="currency">{{ item.WeeklyTotal }}</td>
            <td class="currency">{{ item.MonthlyTotal }}</td>
            <td class="currency">{{ item.YearlyTotal }}</td>
        </tr>
        {% endfor%}
    </table>
    <br>

{% if income_list %}
<table rules="groups">
        <tr>
            <th>Income</th>
            <th>Frequency</th>
            <th>Amount</th>
            <th>Weekly</th>
            <th>Monthly</th>
            <th>Yearly</th>
        </tr>
    {% for vibudgetItem in income_list %}
        <tr>
            <td class="itemname"><a href="/budget/{{ vibudgetItem.bi.id }}/">{{ vibudgetItem.Name}}</a></td>
            <td>{{ vibudgetItem.Frequency}}</td>
            <td class="currency">{{ vibudgetItem.Amount}}</td>
            <td class="currency">{{ vibudgetItem.Weekly}}</td>
            <td class="currency">{{ vibudgetItem.Monthly}}</td>
            <td class="currency">{{ vibudgetItem.Yearly}}</td>
        </tr>
    {% endfor %}
    </table>
{% endif %}
<br>
{% if spending_list %}
<table rules="groups">
        <tr>
            <th>Spending</th>
            <th>Frequency</th>
            <th>Amount</th>
            <th>Weekly</th>
            <th>Monthly</th>
            <th>Yearly</th>
        </tr>
    {% for vibudgetItem in spending_list %}
        {% ifequal vibudgetItem.ItemType 1 %}
        <tr class="group1">
            <td>{{ vibudgetItem.Name}}</td>
        {% else %}
        <tr>
            <td class="itemname"><a href="/budget/{{ vibudgetItem.bi.id }}/">{{ vibudgetItem.Name}}</a></td>
        {% endifequal %}
            <td>{{ vibudgetItem.Frequency}}</td>
            <td class="currency">{{ vibudgetItem.Amount}}</td>
            <td class="currency">{{ vibudgetItem.Weekly}}</td>
            <td class="currency">{{ vibudgetItem.Monthly}}</td>
            <td class="currency">{{ vibudgetItem.Yearly}}</td>
        </tr>
    {% endfor %}
    </table>
{% endif %}

</div>
</div>
